package com.game.spacetrader;
import java.io.Serializable;
import java.util.*;

/**
 * Random Event class 
 * Handles random events
 */


public class RandomEvent implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String event, effect;
	private Random rand;
	private int eventNum;
	

	public RandomEvent(){
		rand = new Random();
		//eventNum = rand.nextInt(9);
		eventNum = rand.nextInt(5);
		switch (eventNum){
		case 1:
			event = "Drought";
			effect = "Water prices x4";
			break;
		case 2:
			event = "Prosparity";
			effect = "Half-Price off everything(somethings might be free :D)";
			break;
		case 3:
			event = "Depression";
			effect = "Triple the price of everything";
			break;
		case 4:
			event = "Famine";
			effect = "Food prices x4";
			break;
		default:
			event = "Normal";
			effect = "";
			break;		
		}
		
	}

	/**
	 * 
	 * @return event
	 */
	public String getEvent() {
		return event;
	}

	/**
	 * 
	 * @return eventNum
	 */
	public int getEventNum() {
		return eventNum;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "is currently experiencing" + event;
	}
	
	/**
	 * effect 
	 * tells what this does
	 * 
	 * @return effect
	 */
	public String effect(){
		return effect;
	}
	
	
	
}
